package com.ajaxjs.entity.enum_validation;

import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE_USE;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

/**
 * 
 */
@Target({ METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = EnumNamePatternValidator.class)
public @interface EnumNamePattern {
	/**
	 * 正则
	 * 
	 * @return
	 */
	String regexp();

	/**
	 * 提示信息
	 * 
	 * @return
	 */
	String message() default "必须匹配 \"{regexp}\"";

	/**
	 * 
	 * @return
	 */
	Class<?>[] groups() default {};

	/**
	 * 
	 * @return
	 */
	Class<? extends Payload>[] payload() default {};
}